var array = [
    {
        name: 'aa',
        from: 'beijin'
    },
    {
        name: 'bb',
        from: 'shanghai'
    },
    {
        name: 'aa',
        from: 'chengdu'
    },
    {
        name: 'aa',
        from: 'beijin'
    }
]

var unique = {}
array.forEach(function(item){
    unique[JSON.stringify(item)] = item
})
console.log(unique)

array = Object.keys(unique).map(function (data) {
    return JSON.parse(data)
})

console.log(array)